package net.framework.smc.kafka.service;

import lombok.extern.slf4j.Slf4j;
import net.framework.smc.kafka.channel.MySource;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.context.annotation.Bean;
import org.springframework.integration.annotation.InboundChannelAdapter;
import org.springframework.integration.annotation.Poller;
import org.springframework.integration.core.MessageSource;
import org.springframework.messaging.support.GenericMessage;

import java.util.Date;

/**
 * @authore zyx
 * @date 2018/7/6 13:24
 */
@EnableBinding(value = {MySource.class})
@Slf4j
public class DemoSender {

//    @Bean
//    @InboundChannelAdapter(value = MySource.OUTPUT, poller = @Poller(fixedDelay = "2000"))
//    public MessageSource<Date> timerMessageSource(){
//        log.info("发送数据=======");
//        return () -> new GenericMessage<>(new Date());
//    }
//
//    @StreamListener(Processor.INPUT)
//    public void receive(@Payload String message) {
//        log.info("处理结果==============="+ message);
//    }
}
